console.log('start');
setTimeout(() => {
    console.log('timeout');
}, 0)
// resolve 静态方法
Promise.resolve().then(() => {
    console.log('resolve');
})

Promise.resolve().then(() => {
    console.log('resolve2');
})

// 宏任务
const p = new Promise((resolve, reject) => {
    console.log('p promise instance');
    setTimeout(() => {
        console.log('++++++++');
        resolve('dddddd');
    }, 1000)
})

console.log('end');

// 执行顺序
// start
// p promise instance
// end
// resolve
// resolve2
// timeout
// ++++++++